import time
import functools
import memory_profiler

def performance_analysis(f):
    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        start_time = time.time()
        initial_memory = memory_profiler.memory_usage()[0]

        result = f(*args, **kwargs)

        end_time = time.time()
        final_memory = memory_profiler.memory_usage()[0]
        
        elapsed_time = end_time - start_time
        memory_used = final_memory - initial_memory

        print(f"{f.__name__}:Elapsed time: {elapsed_time:<10.6f} seconds\tMemory used: {memory_used:<10.6f} MiB")
        
        return result
    return wrapper

@performance_analysis
def example_function(n):
    return sum([i * i for i in range(n)])

example_function(100000)